/*
 * @Author: 霍雷
 * @Date: 2022-05-23 15:01:37
 * @LastEditors: 霍雷
 * @LastEditTime: 2022-05-23 17:03:46
 * @FilePath: \gua-dev-starter\dev-kit\plop-templates\store\prompt.js
 * @Discription:
 * @Description:
 */
export default {
  description: '创建全局状态',
  prompts: [
    {
      type: 'input',
      name: 'name',
      message: '请输入文件名称',
      validate: (v) => {
        if (!v || v.trim === '') {
          return '文件名称不能为空'
        } else {
          return true
        }
      },
    },
  ],
  actions: () => {
    const actions = [
      {
        type: 'add',
        path: 'src/store/modules/{{name}}.ts',
        templateFile: 'dev-kit/plop-templates/store/index.hbs',
      },
    ]
    return actions
  },
}
